package module.scene.elements
{
	import com.greensock.TweenMax;
	
	import flash.display.Sprite;
	
	/**
	 * @author 缺硒
	 */
	public class Mineral extends Sprite implements IMicroElement
	{
		private static var __color:uint = 0xff99cc;
		private var _playFrame:int = 1;
		
		public function Mineral()
		{
			drawShape();
		}
		
		private function drawShape():void
		{
			graphics.beginFill(__color);
			graphics.drawCircle(0,0,5);
			graphics.endFill();
			doAnimation();
		}
		
		private function doAnimation():void
		{
			if(_playFrame == 1)
			{
				TweenMax.to(this, 1, {glowFilter:{color:__color, alpha:1, blurX:20, blurY:20, strength:10}, onComplete:doAnimation});
				_playFrame = 2;
			}
			else
			{
				TweenMax.to(this, 1, {glowFilter:{color:__color, alpha:1, blurX:10, blurY:10, strength:10}, onComplete:doAnimation});
				_playFrame = 1;
			}
		}
		//
	}
}